The function returns a list. mgs
returns a list
containing the matrices Q and R. The members of the
list can be accessed by:
> aa = rand(4,4)
aa =
matrix columns 1 thru 4
0.7 0.96 0.924 0.148
0.95 0.915 0.0882 0.879
0.0918 0.441 0.908 0.00543
0.902 0.0735 0.362 0.222
> x = mgs (aa)
q r
> x.q
q =
matrix columns 1 thru 4
0.47 0.513 0.261 -0.669
0.638 0.243 -0.613 0.396
0.0617 0.436 0.642 0.628
0.606 -0.698 0.379 0.0378
> mgs (aa).q
q =
matrix columns 1 thru 4
0.47 0.513 0.261 -0.669
0.638 0.243 -0.613 0.396
0.0617 0.436 0.642 0.628
0.606 -0.698 0.379 0.0378